import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type homeResult = {
  page: any;
  result: any
};

/** 查询产品分类信息 */
export const getselpage = () => {
  return http.request<homeResult>("get", baseUrlApi(`/api/backend/productclass/selpage`));
};



/** 新增产品分类信息 */
export const inserclass = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/productclass/inserclass"), { data });
};

/** 修改产品分类信息 */
export const grclass = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/productclass/grclass"), { data });
};


/** 删除产品分类信息 */
export const delinfo = (userid?: string | number) => {
  return http.request<homeResult>("delete", baseUrlApi(`/api/backend/productclass/delinfo/${userid}`));
};

/** 首页下侧展示菜单查询 */
export const productclassselhopa = () => {
  return http.request<homeResult>("get", baseUrlApi(`/api/backend/productclass/selhopa`));
};

/** 首页下侧展示菜单编辑 */
export const productclassinserthopa = (data?: object) => {
  return http.request<homeResult>("post", baseUrlApi("/api/backend/productclass/inserthopa"), { data });
};

